﻿<UserControl x:Class="Microsoft.Samples.Kinect.WpfViewers.KinectDiagnosticViewer"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:kt="clr-namespace:Microsoft.Samples.Kinect.WpfViewers"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <WrapPanel Orientation="Horizontal">
        <StackPanel Orientation="Vertical">
            <StackPanel>
                <TextBlock FontSize="12" Text="Color Image" HorizontalAlignment="Center"/>
                <kt:KinectColorViewer Width="400" Height="300" x:Name="kinectColorViewer" 
                                  x:FieldModifier="public" Margin="10 0 10 10"/>
            </StackPanel>
            <StackPanel>
                <TextBlock FontSize="12" Text="Depth Image" HorizontalAlignment="Center"/>
                <kt:KinectDepthViewer Width="400" Height="300" x:Name="kinectDepthViewer" 
                                  x:FieldModifier="public" Margin="10 0 10 10"/>
            </StackPanel>
        </StackPanel>
        <StackPanel Orientation="Vertical">
            <StackPanel Name="skeletonPanel">
                <TextBlock FontSize="12" Text="Detected Skeletons" HorizontalAlignment="Center"/>
                <Canvas Width="400" Height="300" Name="skeletonCanvas" Margin="10 0 10 10"
                    Background="Black" ClipToBounds="True"/>
            </StackPanel>
            <StackPanel Orientation="Vertical">
                <StackPanel Orientation="Vertical" Visibility="Collapsed">
                    <TextBlock FontSize="12" HorizontalAlignment="Center" >Framerate</TextBlock>
                    <StackPanel Orientation="Vertical" TextBlock.Foreground="White" Background="Black">
                        <TextBlock FontSize="36" Name="frameRate" HorizontalAlignment="Center"
                           Text="{Binding ElementName=kinectDepthViewer,Path=FrameRate}" />
                        <TextBlock FontSize="18" HorizontalAlignment="Center">FPS</TextBlock>
                    </StackPanel>
                    <TextBlock FontSize="12" HorizontalAlignment="Center" Visibility="Collapsed" >Kinect Index</TextBlock>
                    <StackPanel TextBlock.Foreground="White" Background="Black" Visibility="Collapsed">
                        <TextBlock FontSize="10" Name="kinectIndex" Text="--" HorizontalAlignment="Center" />
                    </StackPanel>

                    <TextBlock FontSize="12" HorizontalAlignment="Center" Visibility="Collapsed" >Kinect Name</TextBlock>
                    <TextBox FontSize="10" Name="kinectName" Text="--" HorizontalAlignment="Center" Visibility="Collapsed"
                     BorderThickness="0" Background="Black" Foreground="White" />
                </StackPanel>
                <StackPanel Orientation="Vertical">
                    <Button Name="START" Background="LightGreen" Click="START_Click" FontSize="24" Height="60">ACTIVATE!</Button>
                </StackPanel>
                <TextBlock FontSize="12" HorizontalAlignment="Center" >Status</TextBlock>
                <StackPanel Orientation="Vertical">
                    <StackPanel Orientation="Horizontal">
                        <StackPanel x:Name="ShowStatsGrid" TextBlock.Foreground="White" Background="Black">
                            <Grid VerticalAlignment="Top" HorizontalAlignment="Left" ShowGridLines="False" Width="300">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition />
                                    <ColumnDefinition />
                                </Grid.ColumnDefinitions>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="30" />
                                    <RowDefinition Height="30"/>
                                    <RowDefinition Height="30"/>
                                    <RowDefinition Height="30"/>
                                    <RowDefinition Height="30"/>
                                    <RowDefinition Height="30"/>
                                </Grid.RowDefinitions>
                                <TextBlock Grid.Row="0" Grid.ColumnSpan="2" FontSize="18" Name="kinectStatus" Text="Not Connected" HorizontalAlignment="Center" Visibility="Collapsed" />
                                <TextBlock Grid.Row="0" Grid.Column="0" FontSize="18" Name="Pedal_text" Text="Pedal Time" HorizontalAlignment="Center" />
                                <TextBlock Grid.Row="0" Grid.Column="1" FontSize="18" Name="RPM" Text="30" HorizontalAlignment="Center" />
                                <TextBlock Grid.Row="1" Grid.Column="0" FontSize="18" Name="tb_Gas" Text="No Gas" HorizontalAlignment="Center" />
                                <TextBlock Grid.Row="1" Grid.Column="1" FontSize="18" Name="tb_Boost" Text="No Boost" HorizontalAlignment="Center" />
                                <TextBlock Grid.Row="2" Grid.Column="0" FontSize="18" Name="tb_Reverse" Text="" HorizontalAlignment="Center" />
                                <TextBlock Grid.Row="2" Grid.Column="1" FontSize="18" Name="tb_EBrake" Text="" HorizontalAlignment="Center" />
                                <TextBlock Grid.Row="5" Grid.Column="1" FontSize="18" Name="tb_A" Text="0" HorizontalAlignment="Center"/>
                                <TextBlock Grid.Row="3" Grid.Column="1" FontSize="18" Name="tb_PedalCount" Text="0" HorizontalAlignment="Center"/>
                                <TextBlock Grid.Row="4" Grid.Column="0" FontSize="18" Name="tb_Lean" Text="0" HorizontalAlignment="Center"/>
                                <TextBlock Grid.Row="5" Grid.Column="0" FontSize="18" Name="tb_Wheelie" Text="0" HorizontalAlignment="Center"/>
                                
                            </Grid>
                            <Button Name="ShowSetValues" Click="ShowSetValues_Click">Show Values</Button>
                            <Popup Name="ConfigSettings" Width="400" Height="400">
                                <Border Background="White" >
                                    <StackPanel Orientation="Vertical" >
                                        <TextBlock Name="myPopupText" 
                 Background="LightBlue" 
                 Foreground="Blue">
        Settings for the application
                                        </TextBlock>
                                        <!--<kt:SettingsControl></kt:SettingsControl>-->
                                        <Grid VerticalAlignment="Top" HorizontalAlignment="Left"  Width="400"  >
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition  />
                                                <ColumnDefinition />
                                                <ColumnDefinition />
                                                <ColumnDefinition />
                                            </Grid.ColumnDefinitions>
                                            <Grid.RowDefinitions>
                                                <RowDefinition Height="20" />
                                                <RowDefinition Height="20"/>
                                                <RowDefinition Height="20"/>
                                                <RowDefinition Height="20"/>
                                                <RowDefinition Height="20"/>
                                                <RowDefinition Height="20"/>
                                                <RowDefinition Height="20"/>
                                                <RowDefinition Height="20"/>
                                                <RowDefinition Height="20"/>
                                                <RowDefinition Height="20"/>
                                                <RowDefinition Height="20"/>
                                                <RowDefinition Height="20"/>
                                                <RowDefinition Height="20"/>
                                                <RowDefinition Height="20"/>
                                            </Grid.RowDefinitions>
                                            <TextBlock Grid.Row="0" Grid.Column="0" FontSize="12" Name="tb_PedalLow" Text="Pedal Slow" HorizontalAlignment="Center" Foreground="Black" />
                                            <TextBox Grid.Row="0" Grid.Column="1" FontSize="12" Name="tb_PedalLowVal" Text="1200" HorizontalAlignment="Center" Width="80"/>
                                            <CheckBox Grid.Row="0" Grid.Column="2" Name="cb_LeftBreak" IsChecked="True" HorizontalAlignment="Center">LeftBreak?</CheckBox>
                                            <TextBox Grid.Row="0" Grid.Column="3" FontSize="12" Name="tb_BreakButton" Text="SPACE" HorizontalAlignment="Center" Width="80"/>
                                            <CheckBox Grid.Row="1" Grid.Column="2" Name="cb_RightReverse" IsChecked="True" HorizontalAlignment="Center">RightReverse?</CheckBox>
                                            <TextBox Grid.Row="1" Grid.Column="3" FontSize="12" Name="tb_ReverseButton" Text="Z" HorizontalAlignment="Center" Width="80"/>
                                            <TextBlock Grid.Row="1" Grid.Column="0" FontSize="12" Name="tb_PedalMedium" Text="Pedal Medium" HorizontalAlignment="Center" Foreground="Black" />
                                            <TextBox Grid.Row="1" Grid.Column="1" FontSize="12" Name="tb_PedalMediumVal" Text="800" HorizontalAlignment="Center" Width="80" />
                                            <TextBlock Grid.Row="2" Grid.Column="0" FontSize="12" Name="tb_PedalBoost" Text="Pedal Boost" HorizontalAlignment="Center" Foreground="Black" />
                                            <TextBox Grid.Row="2" Grid.Column="1" FontSize="12" Name="tb_PedalBoostVal" Text="650" HorizontalAlignment="Center" Width="80"  />
                                            <TextBlock Grid.Row="3" Grid.Column="0" FontSize="12" Name="tb_GasKey" Text="GasKey" HorizontalAlignment="Center" Foreground="Black" />
                                            <TextBox Grid.Row="3" Grid.Column="1" FontSize="12" Name="tb_GasKeyVal" Text="A" HorizontalAlignment="Center" Width="80" />
                                            <TextBlock Grid.Row="4" Grid.Column="0" FontSize="12" Name="tb_BoostKey" Text="BoostKey" HorizontalAlignment="Center" Foreground="Black" />
                                            <TextBox Grid.Row="4" Grid.Column="1" FontSize="12" Name="tb_BoostKeyVal" Text="LSHIFT" HorizontalAlignment="Center" Width="80" />
                                            <CheckBox Grid.Row="5" Grid.Column="0" Name="cb_Lean" IsChecked="True" HorizontalAlignment="Center">Lean?</CheckBox>
                                            <CheckBox Grid.Row="5" Grid.Column="2" Grid.ColumnSpan="2" Name="cb_LeanHead" IsChecked="False" HorizontalAlignment="Center">Lean With Head</CheckBox>
                                            <TextBox Grid.Row="5" Grid.Column="1" FontSize="12" Name="tb_DeadZoneVal" Text=".08" HorizontalAlignment="Center" Width="80" />
                                            <TextBlock Grid.Row="6" Grid.Column="0" FontSize="12" Name="tb_LeftKey" Text="Lean Left" HorizontalAlignment="Center" Foreground="Black" />
                                            <TextBox Grid.Row="6" Grid.Column="1" FontSize="12" Name="tb_LeftKeyVal" Text="A" HorizontalAlignment="Center" Width="80" />
                                            <TextBlock Grid.Row="7" Grid.Column="0" FontSize="12" Name="tb_RightKey" Text="Lean Right" HorizontalAlignment="Center" Foreground="Black" />
                                            <TextBox Grid.Row="7" Grid.Column="1" FontSize="12" Name="tb_RightKeyVal" Text="D" HorizontalAlignment="Center" Width="80" />
                                            <CheckBox Grid.Row="8" Grid.Column="0" Name="cb_Wheelie" IsChecked="True" HorizontalAlignment="Center">Allow Wheelies</CheckBox>
                                            <TextBox Grid.Row="8" Grid.Column="1" FontSize="12" Name="tb_WheelieDeadZoneVal" Text=".08" HorizontalAlignment="Center" Width="80" />
                                            <TextBlock Grid.Row="9" Grid.Column="0" FontSize="12" Name="tb_ForwardKey" Text="Forward Key" HorizontalAlignment="Center" Foreground="Black" />
                                            <TextBox Grid.Row="9" Grid.Column="1" FontSize="12" Name="tb_ForwardKeyVal" Text="UP" HorizontalAlignment="Center" Width="80" Foreground="Black"  />
                                            <TextBlock Grid.Row="10" Grid.Column="0" FontSize="12" Name="tb_BackwardKey" Text="Backward Key" HorizontalAlignment="Center" Foreground="Black" />
                                            <TextBox Grid.Row="10" Grid.Column="1" FontSize="12" Name="tb_BackwardKeyVal" Text="DOWN" HorizontalAlignment="Center" Width="80" Foreground="Black" />
                                            <CheckBox Grid.Row="11" Grid.Column="0" Grid.ColumnSpan="4" Name="cb_IsFront" IsChecked="True" HorizontalAlignment="Center">Kinect is Infront of you</CheckBox>
                                            <CheckBox Grid.Row="12" Grid.Column="0" Grid.ColumnSpan="4" Name="cb_IsBiking" IsChecked="True" HorizontalAlignment="Center">Biking Controls (If Running uncheck the box)</CheckBox>
                                        </Grid>
                                        <Button Name="CloseSettings" Click="CloseSettings_Click">Save and Close</Button>
                                    </StackPanel>
                                </Border>
                            </Popup>
                            
                        </StackPanel>
                        <StackPanel Orientation="Vertical" Width="110">
                            <Button Name="Preset1" Click="Preset_Click" FontSize="16" Width="90" Margin="10">Burnout</Button>
                            <Button Name="Preset2" Click="Preset_Click" FontSize="16" Width="90" Margin="10">Sky Drift</Button>
                            <Button Name="Preset3" Click="Preset_Click" FontSize="16" Width="90" Margin="10">GTA</Button>
                            <Button Name="Preset4" Click="Preset_Click" FontSize="16" Width="90" Margin="10">Road Rash</Button>
                            <Button Name="Preset5" Click="Preset_Click" FontSize="16" Width="90" Margin="10">Preset5</Button>
                        </StackPanel>
                    </StackPanel>
                </StackPanel>
            </StackPanel>
        </StackPanel>
    </WrapPanel>
</UserControl>
